import type { Ref } from 'vue'
import { computed } from 'vue'
import { unwrapElement } from './floating-ui-utils/unwrapElement'
// export function getElementX(e: Ref<HTMLElement>): number {
//   //const element=unwrapElement(e)
//   return e.value.getBoundingClientRect().x
// }

export function getElementX(e: Ref<HTMLElement>): number {
  // const element = computed(() => {
  //   return unwrapElement(e)
  // })
  return e.value?.getBoundingClientRect().x
}
// export function getElementY(e: HTMLElement): number {
//   return e.getBoundingClientRect().y
// }

// export function getElementMiddleX(e: HTMLElement): number {
//   return Math.ceil((getElementX(e) + e.offsetWidth) / 2)
// }

// export function getElementMiddleY(e: HTMLElement): number {
//   return Math.ceil((getElementY(e) + e.offsetHeight) / 2)
// }

function getElementYY() {}
